if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_reviewOrder]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_reviewOrder]
GO
CREATE PROC sp_reviewOrder
	@orderID	int,
	@status		int,
	@approvedID	int,	
	@reason		nvarchar(200)
AS
BEGIN
	DECLARE @date datetime
	SELECT @date=getdate()
	UPDATE OrderRequest
		SET 
			Status = @status,
			ApprovedByUser = @approvedID,
			RejectReason = @reason,
			LastUpdate = @date
		WHERE ID = @orderID
END